<?php
define('ROOT_PATH','./');
define('TEMPLATE_DIR','client/');
require_once(ROOT_PATH.'code/bean/config.inc.php');
require_once(ROOT_PATH.'code/class/client/class.client_user.php');
require_once(ROOT_PATH.'code/class/client/class.client_my_ques.php');
require_once(ROOT_PATH.'code/bean/smarty.config.inc.php');
require_once(ROOT_PATH.'code/bean/db_config.inc.php');
require_once(ROOT_PATH.'code/class/client/class.union.php');

$url=$_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING'];
setcookie('user_return_url',$url,time()+360000,'/');

$user=new client_user();
check_login();
if(!$_COOKIE['tovy_login'])
{
	js_alert('请先登录',1,'index.php');
}
$my_ques_list=new my_ques_list();
$page=(isset($_GET['page']) && $_GET['page']>0)?$_GET['page']:1;
if(isset($_GET['finish'])) {
	$finish=(isset($_GET['finish']) && ($_GET['finish']==0 || $_GET['finish']==1)) ? $_GET['finish'] : 0;
	$my_ques_list->get_list_page($finish,$page);
}else $my_ques_list->get_list();

$objUnion = new union();
$siteInfo = $objUnion->getSiteInfo();
$newsList = $objUnion->getNews(2,'',5);//平台新闻
$tpl->assign("nickname",$user->nick_name);
$tpl->assign('siteInfo',$siteInfo);
$tpl->assign('ptxw',$newsList);	//var_dump($newsList);



$tpl->assign('my_ques_list',$my_ques_list);
$tpl->assign('user',$user);
$tpl->assign('ques_class_list','tpl/ques_class_list.tpl');
$tpl->assign('left_user_info','tpl/left_user_info.tpl');
if(isset($_GET['finish']))
    $tpl->display('my_ques_list_page.html');
else $tpl->display('my_ques_list.html');

?>